ALTER TABLE Promotion
ADD Deleted BIT NOT NULL DEFAULT(0)
GO
CREATE PROCEDURE spAPI_Business_DeletePromotion
(
	@Token VARCHAR(255),
	@PromotionId INT
)
AS
BEGIN
	SET NOCOUNT ON
	
	DECLARE @IdResult INT
	DECLARE @BusinessId INT
	
	SET @IdResult = 0
	EXEC spAPI_Business_CheckToken @Token = @Token, @Result = @IdResult OUT, @BusinessId = @BusinessId OUT
	
	IF @IdResult = 1
		UPDATE Promotion
		SET Deleted = 1
		WHERE PromotionId = @PromotionId
			AND BusinessId = @BusinessId
		
	SELECT @IdResult AS IdResult
END
GO